package com.caits.lbs.framework;

import org.slf4j.Logger;

import com.caits.lbs.bean.dbmodel.ETBase;
import com.caits.lbs.framework.log.CommonLogFactory;
import com.caits.lbs.framework.log.CommonSlf4jLogFactory;

/**
 * <p>
 * Constants
 * </p>
 * <p>
 * 用途：全局参数类，业务系统全局的参数类应该继承此类
 * </p>
 * 
 * @author 周华彬(zhouhuabin@ctfo.com, zhou_hua_bin@163.com)
 * @version 0.0.1 2011-5-12
 *          <table style="border:1px solid gray;">
 *          <tr>
 *          <th width="100px">版本号</th>
 *          <th width="100px">动作</th>
 *          <th width="100px">修改人</th>
 *          <th width="100px">修改时间</th>
 *          </tr>
 *          <!-- 以 Table 方式书写修改历史 -->
 *          <tr>
 *          <td>0.0.0</td>
 *          <td>创建类</td>
 *          <td>zhb</td>
 *          <td>2011-5-12 上午11:21:47</td>
 *          </tr>
 *          <tr>
 *          <td>0.0.1</td>
 *          <td>创建类</td>
 *          <td>zhb</td>
 *          <td>2011-5-12 上午11:21:47</td>
 *          <td>0.0.2</td>
 *          <td>修改类</td>
 *          <td>xxx</td>
 *          <td>x年x月x日</td>
 *          </tr>
 *          </table>
 */
public class Constants extends ETBase{
	/** 变量:TODO,类型:long */
	private static final long serialVersionUID = 1759499917757534206L;
	/** TODO */
	/** 默认返回类型*/
	public static final String RESULT_TYPE_XML = "xml";
	/** 返回类型json*/
	public static final String RESULT_TYPE_JSON = "json";
	/** 二进制返回类型*/
	public static final String RESULT_TYPE_BINARY_ = "binary";
	
	
	/** 内容类型(json,utf8)*/
	public final static String ContentTypeJsonUtf8 = "application/json;charset=UTF-8";
	/** 内容类型(xml,utf8)*/
	public final static String ContentTypeXmlUtf8 = "application/xml;charset=UTF-8";
	/** 内容类型(二进制流格式)*/
	public final static String ContentTypeBin = "application/octet-stream";
	/** 内容类型Content-Disposition,下载文件名称*/
	public final static String ContentTypeDisposition = "attachment;filename=";
	/** 变量:附件key,类型:String */
	public final static String ContentDisposition="Content-Disposition";
	/** 内容类型(压缩文件格式)*/
	public final static String ContentTypeZip = "application/zip";
	
	
	/** 变量:返回结果的消息key,类型:String */
	public static final String RESULTMSG ="return_msg";
	/** 变量:返回的数据对象key,类型:String */
	public static final String RESULTDATA ="data";
	/** 变量:返回结果的状态码key,类型:String */
	public static final String RESULTCODE ="return_code";
	/** 参数检查成功*/
	public static final String PARAMCHECK_OK = "100"; 
	/** 参数检查错误*/
	public static final String PARAMCHECK_ERR = "111"; 
	/** 返回码:成功*/
	public static final String RESULTCODE_SUCCESS = "200";
	/** 返回码:服务器错误*/
	public static final String RESULTCODE_SERVERERROR = "500";
	/** 返回码:结果为空*/
	public static final String RESULTCODE_RESULTISNULL = "910";
	
	/** 返回码常量定义:0-5000 */
	public static final String RESULTMSG_ERR = "ERR-";
	public static final String RESULTMSG_OK = "OK";
	
	public static final String MANAGEMENT_JMX_ENABLE = "com.sun.management.jmxremote.enable";
	public static final String MANAGEMENT_JMX_PORT="com.sun.management.jmxremote.port";
	public static final String MANAGEMENT_JMX_NAME="jmxServer";
	
	/** web访问ssion关键字 */
	public static final String WEB_SESSION = "WEB_SESSION";
	
	/** 日志行最大输出长度 */
	public static int max_log_output = 1024;
	/** 系统默认记录分页大小 */
	private int defaultPageSize = 30;
	
	/** 变量:slf4j的api,类型:Logger */
	public static Logger LOGSLF = CommonSlf4jLogFactory.getLog();
	/** 变量:log4j的api,类型:org.apache.log4j.Logger */
	public static org.apache.log4j.Logger LOG4J = CommonLogFactory.getLog();
	
	public Constants() {
		
	}

	/**
	 * 字段 defaultPageSize 设置函数 : int
	 * 
	 * @param defaultPageSize
	 *            the defaultPageSize to set
	 */
	public void setDefaultPageSize(int defaultPageSize) {
		this.defaultPageSize = defaultPageSize;
	}

	/**
	 * 字段 defaultPageSize 获取函数
	 * 
	 * @return the defaultPageSize
	 */
	public int getDefaultPageSize() {
		return defaultPageSize;
	}

	

	/**
	 * 设置变量 max_log_output 的值，数据类型：int
	 * @param max_log_output the max_log_output to set
	 */
	public void setMax_log_output(int max_log_output) {
		Constants.max_log_output = max_log_output;
	}

	/**
	 * 获取变量max_log_output的值
	 * @return the max_log_output 数据类型 : int
	 */
	public int getMax_log_output() {
		return max_log_output;
	}
	
	
}